package cn.edu.ctbu.datajpa01.service;

import cn.edu.ctbu.datajpa01.domain.Teacher;
import cn.edu.ctbu.datajpa01.repository.TeacherRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService {

    @Autowired
    private TeacherRepository teacherRepository;



    public List<Teacher> findLastTeacher() {
        return teacherRepository.findTeacherWithSamePrefix();
    }

    public List<Teacher> getAll(){
        return teacherRepository.findAll();
    }
}

